<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of GridManage
 *
 * @author Administrator
 */
class GridManage extends WMS_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->service('wms/grid_service');
        $userData = $this->session->userdata('users');
        $this->whsCode = $userData['user_main_whs_code'];
    }

    function addPanel()
    {
        $data['whsCode'] = $this->whsCode;
        $this->load->view('defaults/wms/add_product_grid_panel', $data);
        $this->load->view('defaults/common/footer');
    }

    public function add()
    {
        header("Content-type: text/html; charset=utf-8");
        $gp = gp();
        $whs_code = $gp['whs_code'];
        $frame_prefix = $gp['frame_prefix'];
        $at_row = $gp['at_row'];
        $at_col = $gp['at_col'];
        $grid_name = $gp['grid_name'];
        $grid_description = $grid_name;
        $rs = $this->grid_service->add_from_detail($whs_code, $frame_prefix, $at_row, $at_col, $grid_name, $grid_description);
        if (FALSE === $rs)
        {
            show_error(lang('wms_tips_20001'));
        }
        redirect(blang_url('wms/GridManage/addPanel'));
    }

}

?>
